package cz.pproproj.aaservice.aasdbmodule;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author David
 * @since 18. 1. 2015
 */
public class AuthorizationModuleContext {
    private static final AuthorizationModuleContext INSTANCE = new AuthorizationModuleContext();

    private final DbManagement _dbManagement;

    public static AuthorizationModuleContext getInstance() {
        return INSTANCE;
    }

    private AuthorizationModuleContext() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("settings/aasDbContext.xml");
        _dbManagement = (DbManagement) applicationContext.getBean("dbManagement");
    }

    public DbManagement getDbManagement() {
        return _dbManagement;
    }
}
